<?php
/* @var $this yii\web\View */

use common\helpers\Html;
use yii\helpers\Url;
use common\assets\WeuiPluginAsset;

$this->title = '视频学院';

WeuiPluginAsset::register($this);
$this->registerJs($this->render('_script.js'));
?>
<?= Html::beginTag('div', $headerOptions) ?>
<div class="video-cateheader">
    <h2><?= $model->name ?></h2>
    <p><?= $dataProvider->totalCount ?>个视频</p>
</div>
<?= Html::endTag('div') ?>

<?php if (!empty($dataProvider->totalCount)): ?>
    <ul class="video-grid">
        <?php foreach ($dataProvider->models as $video): ?>
            <li>
                <a href="<?= Url::to(['view', 'id' => $video->id]) ?>" class="panel-item">
                    <div class="panel-media">
                        <?= Html::img($video->cover, '', true) ?>
                    </div>
                    <div class="panel-body">
                        <h2><?= $video->title ?></h2>
                        <p><?= $video->description ?></p>
                    </div>
                </a>
            </li>
        <?php endforeach; ?>
    </ul>
<?php endif; ?>
